package com.intelligent.service;

import com.intelligent.pojo.ProductionWorkOrders;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.Date;
import java.util.Map;

/**
* @author lenovo
* @description 针对表【production_work_orders(生产工单质表)】的数据库操作Service
* @createDate 2025-09-04 10:06:52
*/
public interface ProductionWorkOrdersService extends IService<ProductionWorkOrders> {
	IPage<Map<String, Object>> pageQuery(
			Page<?> page,
			String workOrderNo,
			Integer status,
			String productCode,
			String productName,
			Integer overtimeStatus,
			Date plannedStartBegin,
			Date plannedStartEnd,
			Date plannedCompletionBegin,
			Date plannedCompletionEnd,
			String username
	);

	/**
	 * 添加生产工单
	 * @param productionWorkOrders 生产工单对象
	 * @return 是否添加成功
	 */
	boolean addProductionWorkOrder(ProductionWorkOrders productionWorkOrders);

	/**
	 * 更新生产工单
	 * @param productionWorkOrders 生产工单对象
	 * @return 是否更新成功
	 */
	boolean updateProductionWorkOrder(ProductionWorkOrders productionWorkOrders);

	/**
	 * 根据ID删除生产工单
	 * @param id 工单ID
	 * @return 是否删除成功
	 */
	boolean deleteProductionWorkOrderById(Long id);

	/**
	 * 根据ID查询生产工单详情（含产品、单位、用户信息）
	 * @param id 工单ID
	 * @return 详情信息
	 */
	java.util.Map<String, Object> getDetailsById(Long id);
}
